﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace InventoryManager
{
    public partial class AddCustomerOrSellerForm : Form
    {
        public string customerOrSellerName;

        public AddCustomerOrSellerForm(bool customerMode)
        {
            InitializeComponent();

            if (customerMode)
                DirectionLabel.Text = "ใส่ชื่อลูกค้า";
            else
            {
                DirectionLabel.Text = "ใส่ชื่อผู้ขาย";
            }
        }

        private void NameTextBox_TextChanged(object sender, EventArgs e)
        {
            NameTextBox.BackColor = Color.White;
        }

        private void OKButton_Click(object sender, EventArgs e)
        {
            if (NameTextBox.Text == "")
                NameTextBox.BackColor = Color.Red;
            else
            {
                customerOrSellerName = NameTextBox.Text;
                this.DialogResult = DialogResult.OK;
            }
        }
    }
}
